package huawei;

import java.util.Arrays;
import java.util.Scanner;

/**
 * 字符串变换最小字符串
 */
public class Q30 {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String string = scanner.nextLine();
        scanner.close();

        char[] charArray = string.toCharArray();
        Arrays.sort(charArray); // 排序


        StringBuilder sb = new StringBuilder(string);
        for (int i = 0; i < sb.length(); i++) {
            if (charArray[i] != sb.charAt(i)) {
                char target = charArray[i];

                for (int j = i + 1; j < sb.length(); j++) {
                    if (target == sb.charAt(j)) {
                        char tmp = sb.charAt(i);
                        sb.setCharAt(i, sb.charAt(j));
                        sb.setCharAt(j, tmp);
                        break;
                    }
                }

                break;
            }
        }

        System.out.println(sb);
    }
}
